## pinyin_converter.py
import pypinyin

class PinyinConverter:
    """
    This class is responsible for converting Chinese characters to Pinyin.
    It utilizes the pypinyin library to perform the conversion.
    """

    @staticmethod
    def convert_to_pinyin(text: str) -> str:
        """
        Converts the given Chinese text to Pinyin.

        Args:
            text (str): The Chinese text to be converted.

        Returns:
            str: The converted Pinyin text.
        """
        # Ensure text is not None or empty, return empty string if it is
        if not text:
            return ""

        # Convert the Chinese text to Pinyin, using the default settings of pypinyin
        # which separates each syllable with a hyphen.
        pinyin_text = pypinyin.lazy_pinyin(text, style=pypinyin.Style.NORMAL)
        
        # Join the list of pinyin syllables into a single string separated by spaces
        return ' '.join(pinyin_text)
